FNAF-FOR-FREE (Temp) Devlog 3
So! In the last devlog I was able to get the office movement working!
(Recap of what I got done from the last devlog.)

Yayyy!! But... something was still missing, and this would be a journey in of itself... that was the camera button.
First I loaded the texture, and placed it onto the screen.

After failing miserably, I got something that actually worked and everything was fine.
So, in the first two FNAF games, the camera is opened by moving your mouse towards it. But I'm not a fan of this way of doing it since especially for high level play, its REALLY simple to make a mistake and accidentally flip the camera up/down. So, I'm using the much simpler and overall better design where you just click the button to flip the camera up.
Now, I explain all of this because... getting a simple mouse press took an entire day to figure out. You see, you can get whether the mouse was pressed at some point pretty easily. The hard part is detecting only ONCE instead of every single frame. I ran into so many issues such as memory corruption, overwriting the value with an already existing one, and more. It was a god damn nightmare.
But... once I got something to work... it was beautiful...
void mouse_polling(SDL_Event event){
SDL_GetMouseState(&mouse_position.x, &mouse_position.y); //Get mouse position
mouse_input_value = event.button.button; //Get mouse click type
switch (event.type) {
case SDL_EVENT_MOUSE_BUTTON_DOWN:
mouse_down = true;
break;
case SDL_EVENT_MOUSE_BUTTON_UP:
mouse_down = false;
break;
}
}
Its everything I could have hoped. Its wonderful, and amazing, and gave me all the information I needed. And it only took like 12 hours. Then I was able to take all the information for that to check when the mouse was clicked, and then I put all into a function, and it all works now!! And I never have to look at the code again until it doesn't work a platform for some asinine reason. :3